-
Notifications
You must be signed in to change notification settings - Fork 1
JSON file validator application and tests #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add linter Fix some lint
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a JSON file validator application for validating JSON files against OpenAPI specifications, specifically designed for Ed-Fi data lake structures.
Key Changes:
- Python-based JSON validator with CLI and programmatic API interfaces
- Support for local and remote OpenAPI specifications (JSON/YAML)
- Comprehensive test suite with fixtures and sample data
- GitHub Actions workflows for CI/CD and security scanning
Reviewed Changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| python/json_validator/validator.py | Core validation logic implementing schema mapping and JSON validation |
| python/json_validator/main.py | Command-line interface with argparse for user interaction |
| python/tests/test_validator.py | Unit tests for validator functionality |
| python/tests/test_cli.py | Unit tests for CLI interface |
| python/tests/conftest.py | Pytest fixtures providing test data and temporary file structures |
| python/pyproject.toml | Poetry project configuration with dependencies |
| python/poetry.lock | Locked dependency versions for reproducible builds |
| simulated-lake/spec/simplified-ds-6.0.yaml | OpenAPI specification for test validation |
| simulated-lake/tpdm/candidates/*.json | Test data files (valid and invalid samples) |
| simulated-lake/ed-fi/assessments/*.json | Test data files for assessment entities |
| .github/workflows/*.yml | CI/CD workflows for testing and security scanning |
| python/README.md, python/USAGE.md | Documentation for installation and usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "id": "40ed08411356433d8e5ea259aa0dce86", | ||
| "candidateIdentifier": "1000043", | ||
| "birthDate": 1974, |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The birthDate field has an incorrect data type. According to the OpenAPI spec and the tpdm_candidate schema (lines 117-119 in conftest.py), birthDate should be a string with format "date", not an integer. The value 1974 should be "1974-XX-XX" format.
| "birthDate": 1974, | |
| "birthDate": "1974-01-01", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very nice catch by Copilot. Of course, in this case, that's exactly the point: I wanted it to be wrong.
| "streetNumberName": "47 East Cowley Street", | ||
| "buildingSiteNumber": "50", | ||
| "doNotPublishIndicator": false, | ||
| "periods": [1,2,3] |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The periods field contains an array of integers [1,2,3], but based on the schema pattern in the OpenAPI spec (line 100), periods should be an array of objects with specific properties, not an array of integers.
| "periods": [1,2,3] | |
| "periods": [ | |
| { "periodNumber": 1 }, | |
| { "periodNumber": 2 }, | |
| { "periodNumber": 3 } | |
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, good catch, but it was deliberately done.
| "id": "40ed08411356433d8e5ea259aa0dce86", | ||
| "candidateIdentifier": "1000043", | ||
| "birthDate": 1974, | ||
| "economicDisadvantaged": "yes", |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The economicDisadvantaged field has an incorrect data type. It should be a boolean value (true or false), not a string ("yes"). This will fail JSON schema validation.
| "economicDisadvantaged": "yes", | |
| "economicDisadvantaged": true, |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Simple tool for validating JSON files using OpenAPI specifications.
GitHub Actions workflows are functional, as shown when I merged to
mainin a fork: sample pull request